<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ConstantUtil
 *
 * @author Administrator
 */
class ConstantUtil {

    //热门下载游戏
    public static $INDEX_HOT_GAMES = 'INDEX_HOT_GAMES';
    //热门下载应用
    public static $INDEX_HOT_APP = 'INDEX_HOT_APP';
    //Index App
    public static $INDEX_APP = 'INDEX_APP';
    //Index App 分页字符串
    public static $INDEX_APP_SHOW = 'INDEX_APP_SHOW';
    //再次免费
    public static $INDEX_FREE_AGAIN = 'INDEX_FREE_AGAIN';
    //最新发布的应用
    public static $INDEX_NEW_APP = 'INDEX_NEW_APP';
    //最新发布的游戏
    public static $INDEX_NEW_GAMES = 'INDEX_NEW_GAMES';
    //App类型
    public static $INDEX_TYPE_APP = 'INDEX_TYPE_APP';
    //游戏类型 
    public static $INDEX_TYPE_GAMES = 'INDEX_TYPE_GAMES';
    //Service  开头的   Service 中的方法数据缓存
    public static $SERVICE_APPSERVICE_LISTAPPLISTBYTYPE = 'SERVICE_APPSERVICE_LISTAPPLISTBYTYPE';
    //Service  开头的   Service 中的方法数据缓存
    public static $SERVICE_MOBILESERVICE_LISTTYPE = '$SERVICE_MOBILESERVICE_LISTTYPE';
    //首页广告
    public static $AD_INDEX = 'AD_INDEX';
    //首页新闻
    public static $NEWS_INDEX = 'NEWS_INDEX';
    //内容内广告
    public static $AD_CONTENT = 'AD_CONTENT';
    //抓取App路径HOST
    public static $LOAD_APP_URL_HOT = 'http://www.iapps.im/components/hot-app.htm';
    //抓取App路径
    public static $LOAD_APP_URL = 'http://www.iapps.im/page/';
    //抓取新闻路径
    public static $LOAD_NEW_URL = 'http://news.cnmo.com/manu_544_';
    //抓取行情路径
    public static $LOAD_PRICE_URL = 'http://price.cnmo.com/manu_544_';
    //抓取评测路径
    public static $LOAD_REVIEWS_URL = 'http://reviews.cnmo.com/manu_544_';
    //抓取专题路径
    public static $LOAD_SUBJECT_URL = 'http://m.163.com/iphone/subject/list.html';
    //缓存时间
    public static $CACHE_TIME = 3600;
    //Ajax读取提示信息
    public static $MOBILE_SUCCESS_TEXT = '数据读取成功';
    public static $MOBILE_PARAMS_NONE = '参数不存在';
    //数据抓取完毕
    public static $IS_LOAD_OVER = '数据抓取完毕';
    //数据发布完毕
    public static $IS_RELEASE_OVER = '数据发布完毕';
    //系统用户
    public static $SYSTEM_USER = 'SYSTEM_USER';
    //Web用户
    public static $WEB_USER = 'WEB_USER';
    //友链
    public static $FRIENDLY_LINK = 'FRIENDLY_LINK';
    //首页Logo
    public static $INDEX_LOGO = 'INDEX_LOGO';
    //Top Logo
    public static $TOP_LOGO = 'TOP_LOGO';
    //Content Logo
    public static $CONTENT_LOGO = 'CONTENT_LOGO';
    //Push Message Host
//    public static $PUSH_MESSAGE_HOST = 'http://localhost:19999/itunesapp/gadgets/pushMessage.shtml';
    public static $PUSH_MESSAGE_HOST = 'http://60.190.31.244:8080/app/gadgets/pushMessage.shtml';
    //缓存首页 静态html 标识
    public static $CACHE_INDEX_FLAG = 'CACHE_INDEX_FLAG';
    //SEO Module
    public static $SEO_MODULE = array('首页', '限时免费', '原创评测', '专题', '排行榜', '新闻');
    //sina weibo app key2889130860
    public static $WEIBO_SINA_APP_KEY = '26828987';
    //sina weibo app Secret3927e625184dd884f2cdaf2133b58c51
    public static $WEIBO_SINA_APP_SECRET = '56556d74d0ce96bd5629ed92c5358714';
    //sina weibo call back url
    public static $WEIBO_SINA_CALL_BACK_URL = 'http://www.baipaopao.com/index.php/Index/sinaWeiboCallback.shtml';
    
    
    //tencent weibo app key
    public static $WEIBO_TENCENT_APP_KEY = '801081864';
    //tencent weibo app Secret
    public static $WEIBO_TENCENT_APP_SECRET = 'bcaec95b315ca520ea3b7890051fba0c';
    //tencent weibo call back url
    public static $WEIBO_TENCENT_CALL_BACK_URL = 'http://www.baipaopao.com/index.php/Index/tencentWeiboCallback.shtml';

    
    //default haed img
    public static $DEFAULT_HAED_IMG = '../Public/images/baipaopao.jpg';
    /**
     * 发送邮件
     * @param type $to
     * @param type $subject
     * @param type $content
     * @param type $headers
     * @return type 
     */
    static function sendMail($to, $subject, $content, $headers) {
        $result = mail($to, $subject, $content, $headers);
        if ($result) {
            return 1;
        }
        return 0;
    }

    /**
     * 复制属性值
     * @param type $from
     * @param type $to
     * @param type $properties 
     */
    static function copyProperties($from, $to, $properties) {
        foreach ($properties as $prop) {
            $to[$prop] = $from[$prop];
        }

        return $to;
    }

    //当前格式化时间
    static function date() {
        return date('Y-m-d H:m:s');
    }

}

?>
